import axios from 'axios'
// import { getToken, removeToken } from '@/utils/auth'
// import Vue from "vue";

// create an axios instance
const service = axios.create({
    baseURL: process.env.BASE_API, // api的base_url
    timeout: 1000 * 20, // request timeout
    // transformRequest: [function(data) {
    //     let ret = ''
    //     for (let it in data) {
    //         ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
    //     }
    //     return ret
    // }],
    // headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
    headers: { 'Content-Type': 'multipart/form-data' }
})

//请求发送拦截
axios.interceptors.request.use((request) => {

   
    
    return request;

}, function(error) {
    
    return Promise.reject(error);
});

//请求返回拦截
axios.interceptors.response.use((response) => {

    
    
    return response;
}, function(error) {
    
    return Promise.reject(error);
});

export default service